<template>
    <div class="tourist">
        <p class="touristTotal">实时游客统计</p>
        <p class="bg"></p>
        <p class="right">可预约总量 <span>9999</span> 人</p>
        <div class="number">
            <span v-for="(item,index) in people" :key="index" >{{ item }}</span>
        </div>
        <div class="echart" ref="echart">
            123
        </div>
    </div>
</template>

<script setup lang='ts'>
import { onMounted, ref } from 'vue';
import * as echarts from 'echarts';
//引入水球图配置项
import 'echarts-liquidfill'

let people=ref<string>('216908人')

let echart=ref()
onMounted(()=>{
    // 获取echart的实例
    let myChart = echarts.init(echart.value)
    // 设置实例的配置项
    myChart.setOption({
        series: [{
            type: 'liquidFill',
            data: [0.6,0.5,0.1],
            color: ['#0000FF', '#007FFF', '#4169E1'],
            itemStyle: {
                opacity: 0.6
            },
            backgroundStyle: {
                borderWidth: 2,
                borderColor: '#808080',
                color: '#ffffff'
            },
            shape: 'circle',
            outline: {
                show: true,
                borderDistance: 3,
                
            },
            radius:'90%',
            label: {
                formatter: '实时游客量',
                fontSize: 16
            },
            
            
        
        }]
        
    
    })
})
</script>

<style scoped lang='scss'>
    .tourist{
        width: 100%;
        flex: 1.2;
        background:url('../../images/dataScreen-main-lb.png') no-repeat;
        background-size: cover;
        .touristTotal{
            margin-top: 10px;
            margin-left: 10px;
            font-size: 20px;
            color: white;
        }
        .bg{
            width: 68px;
            height: 7px;
            background: url('../../images//dataScreen-title.png') no-repeat;
            background-size: cover;
            margin-top: 10px;
            margin-left: 10px;
        }
        .right{
            float:right;
            color: white;
            span{
                color: yellow;
            }
        }
        .number{
            margin-top: 30px;
            display: flex;
            padding: 20px;
            span{
                flex: 1;
                height: 40px;
                text-align: center;
                color: aqua;
                font-size: 30px;
                background: url('../../images//total.png') no-repeat;
                background-size: cover;
            }
        }
        .echart{
            width: 100%;
            height: 240px;
            
        }
    }
</style>